home *** CD-ROM | disk | FTP | other *** search
Wrap
bbbbuuuuffff((((DDDD4444)))) bbbbuuuuffff((((DDDD4444)))) NNNNAAAAMMMMEEEE _bbbb_uuuu_ffff - block I/O data transfer structure SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_tttt_yyyy_pppp_eeee_ssss_...._hhhh_>>>> _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_pppp_rrrr_oooo_cccc_...._hhhh_>>>> _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_bbbb_uuuu_ffff_...._hhhh_>>>> _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_yyyy_ssss_////_dddd_dddd_iiii_...._hhhh_>>>> DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN The _bbbb_uuuu_ffff structure is the basic data structure for block I/O transfers. UUUUSSSSAAAAGGGGEEEE Each block I/O transfer has an associated buffer header. The header contains all the buffer control and status information. For drivers, the buffer header pointer is the sole argument to a block driver _ssss_tttt_rrrr_aaaa_tttt_eeee_gggg_yyyy(D2) routine. Do not depend on the size of the _bbbb_uuuu_ffff structure when writing a driver. It is important to note that a buffer header may be linked in multiple lists simultaneously. Because of this, most of the members in the buffer header cannot be changed by the driver, even when the buffer header is in one of the drivers' work lists. Buffer headers may be used by the system to describe a portion of the kernel data space for I/O for block drivers. Buffer headers are also used by the system for physical I/O for block drivers. In this case, the buffer describes a portion of user data space that is locked into memory (see _pppp_hhhh_yyyy_ssss_iiii_oooo_cccc_kkkk(D3)). Block drivers often chain block requests so that overall throughput for the device is maximized. The _aaaa_vvvv______ffff_oooo_rrrr_wwww and the _aaaa_vvvv______bbbb_aaaa_cccc_kkkk members of the _bbbb_uuuu_ffff structure can serve as link pointers for chaining block requests. SSSSttttrrrruuuuccccttttuuuurrrreeee DDDDeeeeffffiiiinnnniiiittttiiiioooonnnnssss The _bbbb_uuuu_ffff structure contains the following members: _uuuu_iiii_nnnn_tttt_6666_4444______tttt _bbbb______ffff_llll_aaaa_gggg_ssss_;;;; _////_**** _BBBB_uuuu_ffff_ffff_eeee_rrrr _ssss_tttt_aaaa_tttt_uuuu_ssss _****_//// _ssss_tttt_rrrr_uuuu_cccc_tttt _bbbb_uuuu_ffff _****_bbbb______ffff_oooo_rrrr_wwww_;;;; _////_**** _KKKK_eeee_rrrr_nnnn_eeee_llll_////_dddd_rrrr_iiii_vvvv_eeee_rrrr _llll_iiii_ssss_tttt _llll_iiii_nnnn_kkkk _****_//// _ssss_tttt_rrrr_uuuu_cccc_tttt _bbbb_uuuu_ffff _****_bbbb______bbbb_aaaa_cccc_kkkk_;;;; _////_**** _KKKK_eeee_rrrr_nnnn_eeee_llll_////_dddd_rrrr_iiii_vvvv_eeee_rrrr _llll_iiii_ssss_tttt _llll_iiii_nnnn_kkkk _****_//// _ssss_tttt_rrrr_uuuu_cccc_tttt _bbbb_uuuu_ffff _****_aaaa_vvvv______ffff_oooo_rrrr_wwww_;;;; _////_**** _DDDD_rrrr_iiii_vvvv_eeee_rrrr _wwww_oooo_rrrr_kkkk _llll_iiii_ssss_tttt _llll_iiii_nnnn_kkkk _****_//// _ssss_tttt_rrrr_uuuu_cccc_tttt _bbbb_uuuu_ffff _****_aaaa_vvvv______bbbb_aaaa_cccc_kkkk_;;;; _////_**** _DDDD_rrrr_iiii_vvvv_eeee_rrrr _wwww_oooo_rrrr_kkkk _llll_iiii_ssss_tttt _llll_iiii_nnnn_kkkk _****_//// _uuuu_nnnn_ssss_iiii_gggg_nnnn_eeee_dddd _iiii_nnnn_tttt _bbbb______bbbb_cccc_oooo_uuuu_nnnn_tttt_;;;; _////_**** _#### _oooo_ffff _bbbb_yyyy_tttt_eeee_ssss _tttt_oooo _tttt_rrrr_aaaa_nnnn_ssss_ffff_eeee_rrrr _****_//// _uuuu_nnnn_iiii_oooo_nnnn _{{{{ _cccc_aaaa_dddd_dddd_rrrr______tttt _bbbb______aaaa_dddd_dddd_rrrr_;;;; _////_**** _BBBB_uuuu_ffff_ffff_eeee_rrrr_''''_ssss _vvvv_iiii_rrrr_tttt_uuuu_aaaa_llll _aaaa_dddd_dddd_rrrr_eeee_ssss_ssss _****_//// _}}}} _bbbb______uuuu_nnnn_;;;; _dddd_aaaa_dddd_dddd_rrrr______tttt _bbbb______bbbb_llll_kkkk_nnnn_oooo_;;;; _////_**** _BBBB_llll_oooo_cccc_kkkk _nnnn_uuuu_mmmm_bbbb_eeee_rrrr _oooo_nnnn _dddd_eeee_vvvv_iiii_cccc_eeee _****_//// _uuuu_nnnn_ssss_iiii_gggg_nnnn_eeee_dddd _iiii_nnnn_tttt _bbbb______rrrr_eeee_ssss_iiii_dddd_;;;; _////_**** _#### _oooo_ffff _bbbb_yyyy_tttt_eeee_ssss _nnnn_oooo_tttt _tttt_rrrr_aaaa_nnnn_ssss_ffff_eeee_rrrr_rrrr_eeee_dddd _****_//// _cccc_llll_oooo_cccc_kkkk______tttt _bbbb______ssss_tttt_aaaa_rrrr_tttt_;;;; _////_**** _RRRR_eeee_qqqq_uuuu_eeee_ssss_tttt _ssss_tttt_aaaa_rrrr_tttt _tttt_iiii_mmmm_eeee _****_//// PPPPaaaaggggeeee 1111 bbbbuuuuffff((((DDDD4444)))) bbbbuuuuffff((((DDDD4444)))) _ssss_tttt_rrrr_uuuu_cccc_tttt _pppp_rrrr_oooo_cccc _****_bbbb______pppp_rrrr_oooo_cccc_;;;; _////_**** _PPPP_rrrr_oooo_cccc_eeee_ssss_ssss _ssss_tttt_rrrr_uuuu_cccc_tttt_uuuu_rrrr_eeee _pppp_oooo_iiii_nnnn_tttt_eeee_rrrr _****_//// _llll_oooo_nnnn_gggg _bbbb______bbbb_uuuu_ffff_ssss_iiii_zzzz_eeee_;;;; _////_**** _SSSS_iiii_zzzz_eeee _oooo_ffff _aaaa_llll_llll_oooo_cccc_aaaa_tttt_eeee_dddd _bbbb_uuuu_ffff_ffff_eeee_rrrr _****_//// _vvvv_oooo_iiii_dddd _((((_****_bbbb______iiii_oooo_dddd_oooo_nnnn_eeee_))))_((((_))))_;;;; _////_**** _FFFF_uuuu_nnnn_cccc_tttt_iiii_oooo_nnnn _cccc_aaaa_llll_llll_eeee_dddd _bbbb_yyyy _bbbb_iiii_oooo_dddd_oooo_nnnn_eeee _****_//// _vvvv_oooo_iiii_dddd _****_bbbb______iiii_oooo_cccc_hhhh_aaaa_iiii_nnnn_;;;; _////_**** _llll_iiii_nnnn_kkkk _pppp_oooo_iiii_nnnn_tttt_eeee_rrrr _ffff_oooo_rrrr _iiii_oooo_dddd_oooo_nnnn_eeee _cccc_hhhh_aaaa_iiii_nnnn _****_//// _dddd_eeee_vvvv______tttt _bbbb______eeee_dddd_eeee_vvvv_;;;; _////_**** _EEEE_xxxx_pppp_aaaa_nnnn_dddd_eeee_dddd _dddd_eeee_vvvv _ffff_iiii_eeee_llll_dddd _****_//// _vvvv_oooo_iiii_dddd _****_bbbb______pppp_rrrr_iiii_vvvv_aaaa_tttt_eeee_;;;; _////_**** _FFFF_oooo_rrrr _dddd_rrrr_iiii_vvvv_eeee_rrrr_''''_ssss _uuuu_ssss_eeee _iiii_nnnn _SSSS_VVVV_RRRR_4444_MMMM_PPPP _oooo_nnnn_llll_yyyy_****_//// The members of the buffer header available to test or set by a driver are described below: _bbbb______ffff_llll_aaaa_gggg_ssss is a bitmask that stores the buffer status and tells the driver whether to read from or write to the device. To avoid an error condition, the driver must never clear the _bbbb______ffff_llll_aaaa_gggg_ssss member or modify its value, except by setting or clearing individual flag bits as described below. Valid flags are as follows: _BBBB______BBBB_UUUU_SSSS_YYYY The buffer is in use. The driver may change this flag only if it acquired the buffer with _gggg_eeee_tttt_rrrr_bbbb_uuuu_ffff(D3), and if no I/O operation is in progress. _BBBB______DDDD_OOOO_NNNN_EEEE The data transfer has completed. The driver should not change this flag. _BBBB______EEEE_RRRR_RRRR_OOOO_RRRR The driver sets _BBBB______EEEE_RRRR_RRRR_OOOO_RRRR to indicate an error occurred during an I/O transfer. On systems where the _bbbb_iiii_oooo_eeee_rrrr_rrrr_oooo_rrrr(D3) function is available, drivers should not access this flag directly. _BBBB______PPPP_AAAA_GGGG_EEEE_IIII_OOOO The buffer is being used in a paged I/O request. If _BBBB______PPPP_AAAA_GGGG_EEEE_IIII_OOOO is set, the _bbbb______pppp_aaaa_gggg_eeee_ssss field of the buffer header points to a list of page structures sorted by block location on the device. Also, the _bbbb______uuuu_nnnn_...._bbbb______aaaa_dddd_dddd_rrrr field of the buffer header is the offset into the first page of the page list. If _BBBB______PPPP_AAAA_GGGG_EEEE_IIII_OOOO is not set, the _bbbb______pppp_aaaa_gggg_eeee_ssss field of the buffer header is not used and the _bbbb______uuuu_nnnn_...._bbbb______aaaa_dddd_dddd_rrrr field of the buffer header contains the starting virtual address of the I/O request (in user address space if _BBBB______PPPP_HHHH_YYYY_SSSS is set or kernel address space otherwise). The driver must not set or clear the _BBBB______PPPP_AAAA_GGGG_EEEE_IIII_OOOO flag. _BBBB______PPPP_HHHH_YYYY_SSSS The buffer header is being used for physical (direct) I/O to a user data area. The _bbbb______uuuu_nnnn_...._bbbb______aaaa_dddd_dddd_rrrr member contains the starting virtual address of the user data area. Note that _BBBB______PPPP_HHHH_YYYY_SSSS and _BBBB______PPPP_AAAA_GGGG_EEEE_IIII_OOOO are never set simultaneously and must not be changed by the driver. _BBBB______RRRR_EEEE_AAAA_DDDD Data are to be read from the peripheral device into main memory. The driver may change this flag only if it acquired the buffer with _gggg_eeee_tttt_rrrr_bbbb_uuuu_ffff(D3), _gggg_eeee_tttt_eeee_bbbb_llll_kkkk(D3), or PPPPaaaaggggeeee 2222 bbbbuuuuffff((((DDDD4444)))) bbbbuuuuffff((((DDDD4444)))) _nnnn_gggg_eeee_tttt_eeee_bbbb_llll_kkkk(D3), and if no I/O operation is in progress. _BBBB______WWWW_RRRR_IIII_TTTT_EEEE Data are to be transferred from main memory to the peripheral device. _BBBB______WWWW_RRRR_IIII_TTTT_EEEE is a pseudo-flag that occupies the same bit location as _BBBB______RRRR_EEEE_AAAA_DDDD. _BBBB______WWWW_RRRR_IIII_TTTT_EEEE cannot be directly tested; it is only detected as the absence of _BBBB______RRRR_EEEE_AAAA_DDDD (_!!!!_((((_bbbb_pppp_----_>>>>_bbbb______ffff_llll_aaaa_gggg_ssss_&&&&_BBBB______RRRR_EEEE_AAAA_DDDD_)))).) _bbbb______ffff_oooo_rrrr_wwww and _bbbb______bbbb_aaaa_cccc_kkkk may only be used by the driver if the buffer was acquired by the driver with the _gggg_eeee_tttt_rrrr_bbbb_uuuu_ffff routine. In that case, these members can be used to link the buffer into driver work lists. _aaaa_vvvv______ffff_oooo_rrrr_wwww and _aaaa_vvvv______bbbb_aaaa_cccc_kkkk can be used by the driver to link the buffer into driver work lists. _bbbb______bbbb_cccc_oooo_uuuu_nnnn_tttt specifies the number of bytes to be transferred for both paged and non-paged I/O requests. The driver may change this member. _bbbb______uuuu_nnnn_...._bbbb______aaaa_dddd_dddd_rrrr is either the virtual address of the I/O request, or an offset into the first page of a page list depending on whether _BBBB______PPPP_AAAA_GGGG_EEEE_IIII_OOOO is set. If it is set, the _bbbb______pppp_aaaa_gggg_eeee_ssss field of the buffer header points to a sorted list of page structures and _bbbb______uuuu_nnnn_...._bbbb______aaaa_dddd_dddd_rrrr is the offset into the first page. If _BBBB______PPPP_AAAA_GGGG_EEEE_IIII_OOOO is not set, _bbbb______uuuu_nnnn_...._bbbb______aaaa_dddd_dddd_rrrr is the virtual address from which data are read or to which data are written. It represents a user virtual address if _BBBB______PPPP_HHHH_YYYY_SSSS is set, or a kernel virtual address otherwise. The driver may change this member. _bbbb______bbbb_llll_kkkk_nnnn_oooo identifies which logical block on the device is to be accessed. The driver may have to convert this logical block number to a physical location such as a cylinder, track, and sector of a disk. The driver may change this member only if it allocated the buffer via _gggg_eeee_tttt_eeee_bbbb_llll_kkkk, _nnnn_gggg_eeee_tttt_eeee_bbbb_llll_kkkk, or _gggg_eeee_tttt_rrrr_bbbb_uuuu_ffff, and if no I/O operation is in progress. _bbbb______rrrr_eeee_ssss_iiii_dddd indicates the number of bytes not transferred. The driver must set this member prior to calling _bbbb_iiii_oooo_dddd_oooo_nnnn_eeee(D3). _bbbb______ssss_tttt_aaaa_rrrr_tttt holds the time the I/O request was started. It is provided for the driver's use in calculating response time and is set by the driver. Its type, _cccc_llll_oooo_cccc_kkkk______tttt, is an integral type upon which direct integer calculations can be performed. It represents clock ticks. _bbbb______pppp_rrrr_oooo_cccc contains the process structure address for the process requesting an unbuffered (direct) data transfer to or from a user data area (this member is set to _NNNN_UUUU_LLLL_LLLL when the transfer is buffered). The process table entry is used to perform proper virtual to physical address translation of the _bbbb______uuuu_nnnn_...._bbbb______aaaa_dddd_dddd_rrrr member. The driver should not change this member. _bbbb______bbbb_uuuu_ffff_ssss_iiii_zzzz_eeee contains the size in bytes of the allocated buffer. The driver may change this member only if it acquired the buffer with _gggg_eeee_tttt_rrrr_bbbb_uuuu_ffff, and if no I/O operation is in progress. PPPPaaaaggggeeee 3333 bbbbuuuuffff((((DDDD4444)))) bbbbuuuuffff((((DDDD4444)))) _((((_****_bbbb______iiii_oooo_dddd_oooo_nnnn_eeee_)))) identifies a specific driver routine to be called by the system when the I/O is complete. If a routine is specified, the _bbbb_iiii_oooo_dddd_oooo_nnnn_eeee(D3) routine does not return the buffer to the system. The driver may change this member if no I/O operation is in progress. _((((_****_bbbb______iiii_oooo_cccc_hhhh_aaaa_iiii_nnnn_)))) If b_iodone has been set by another driver layer, it is important to preserve its value and make sure it is called upon i/o completion. b_iochain is proved for this purpose. For example, a driver that wishes to use b_iodone should save the old value of b_iodone and b_iochain and write the address of these saved values into b_iochain and its completion routines address into b_iodone. When the completion routine is called, it should restore both b_iodone and b_iochain and call biodone() with the buffer again. _bbbb______eeee_dddd_eeee_vvvv contains the external device number of the device. The driver may change this member only if it allocated the buffer via _gggg_eeee_tttt_eeee_bbbb_llll_kkkk, _nnnn_gggg_eeee_tttt_eeee_bbbb_llll_kkkk, or _gggg_eeee_tttt_rrrr_bbbb_uuuu_ffff, and if no I/O operation is in progress. WWWWaaaarrrrnnnniiiinnnnggggssss Buffers are a shared resource within the kernel. Drivers should only read or write the members listed in this section in accordance with the rules given above. Drivers that attempt to use undocumented members of the _bbbb_uuuu_ffff structure risk corrupting data in the kernel and on the device. DDI/DKI-conforming drivers may only use buffer headers that have been allocated using _gggg_eeee_tttt_eeee_bbbb_llll_kkkk, _nnnn_gggg_eeee_tttt_eeee_bbbb_llll_kkkk, or _gggg_eeee_tttt_rrrr_bbbb_uuuu_ffff, or have been passed to the driver _ssss_tttt_rrrr_aaaa_tttt_eeee_gggg_yyyy routine. RRRREEEEFFFFEEEERRRREEEENNNNCCCCEEEESSSS biodone(D3), bioerror(D3), biowait(D3), brelse(D3), clrbuf(D3), freerbuf(D3), geteblk(D3), geterror(D3), getrbuf(D3), iovec(D4), ngeteblk(D3), physiock(D3), strategy(D2), uio(D4), uiophysio(D3X). PPPPaaaaggggeeee 4444